package com.gardenguell.salad.ui.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.gardenguell.salad.R;
import com.gardenguell.salad.data.client.SaladClient;
import com.gardenguell.salad.data.model.Box;
import com.gardenguell.salad.data.volley.OnErrorResponse;
import com.gardenguell.salad.data.volley.OnSuccessResponse;

import java.util.List;

public class TestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);

        ((Button)findViewById(R.id.btn_test)).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SaladClient saladClient = new SaladClient();
                saladClient.removeBox("a0a0a0b0b0b1", "test", new OnSuccessResponse<Box>() {
                    @Override
                    public void onSuccessWithList(List<Box> list) {
                        super.onSuccessWithList(list);
                    }
                }, new OnErrorResponse() {
                    @Override
                    public void onError(int errorCode) {

                    }
                });
            }
        });


        ((Button)findViewById(R.id.btn_test_add)).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SaladClient saladClient = new SaladClient();
                saladClient.addBox("001fa8006710", "test", new OnSuccessResponse() {

                }, new OnErrorResponse() {
                    @Override
                    public void onError(int errorCode) {

                    }
                });
            }
        });
    }

}
